<?php
namespace app\serverarticle\validate;

use \app\manage\validate\BaseValidate;
/**
 * @Author: 蒋哲
 * @Date:   2017-05-25 11:49:42
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-05-27 10:46:23
 */
class ArticleClassify extends BaseValidate
{
    protected $rule = [
        'name'   => ['min'=>2],
        'key'    => ['length'=>'32'],
        'id'     => ['number', 'gt'=>0],
        'pid'    => ['number', 'egt'=>0],
        'status' => ['in'=>['-1','0','1']],
        'add_user_id' => ['integer','gt'=>0],
        'order' => ['integer', 'egt'=>0],
    ];

    protected $message = [
    ];

    protected $scene = [
        'add'        => ['name', 'key', 'pid','order',"status"=>['in'=>['0','1']],'add_user_id'],
        'edit'       => ['id','name', 'key', 'pid','order',"status"=>['in'=>['0','1']],'add_user_id'],
        'enable'     => ['id','key'],
        'pid'        => ['pid','key'],
        'status'     => ['status'],
    ];
}